home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
redakcyjne
/
programy
/
Weather Watcher Live 6.1.23
/
WWL6123.exe
/
{app}
/
Skins
/
Interface
/
Splendid2
/
Includes
/
Splendid.js
< prev
Wrap
Text File
|
2009-12-27
|
27KB
|
757 lines
var windArrowDirection = "S";
var lastWindDirection;
//***************************************************
//* Prevent from highlighting text in web browser *
//***************************************************
document.onselectstart = new Function ("var controlType = (document.selection.createRange()).parentElement().nodeName.toUpperCase(); return controlType == 'INPUT'");
//*********************************************
//* Used to interact with the WWL interface *
//*********************************************
function setRunAction(action)
{ document.getElementById("WW-RunAction").innerHTML = action;
}
//***************************
//* Bottom menu functions *
//***************************
var newsMenuOpen = false;
var healthMenuOpen = false;
var videosMenuOpen = false;
var photosMenuOpen = false;
var camerasMenuOpen = false;
function showMenu(menuName)
{ hideAllMenus(menuName);
document.getElementById(menuName).style.display="";
switch (menuName)
{ case "WW-NewsMenu":
newsMenuOpen = true;
break;
case "WW-HealthMenu":
healthMenuOpen = true;
break;
case "WW-VideosMenu":
videosMenuOpen = true;
break;
case "WW-PhotosMenu":
photosMenuOpen = true;
break;
case "WW-CamerasMenu":
camerasMenuOpen = true;
break;
}
}
function hideMenu(menuName)
{ switch (menuName)
{ case "WW-NewsMenu":
if (newsMenuOpen == false)
{ document.getElementById('WW-NewsMenu').style.display='none';
document.getElementById('WW-NewsMenuImg').src='../../Images/Links/NewsOff.gif';
}
break;
case "WW-HealthMenu":
if (healthMenuOpen == false)
{ document.getElementById('WW-HealthMenu').style.display='none';
document.getElementById('WW-HealthMenuImg').src='../../Images/Links/HealthOff.gif';
}
break;
case "WW-VideosMenu":
if (videosMenuOpen == false)
{ document.getElementById('WW-VideosMenu').style.display='none';
document.getElementById('WW-VideosMenuImg').src='../../Images/Links/VideosOff.gif';
}
break;
case "WW-PhotosMenu":
if (photosMenuOpen == false)
{ document.getElementById('WW-PhotosMenu').style.display='none';
document.getElementById('WW-PhotosMenuImg').src='../../Images/Links/PhotosOff.gif';
}
break;
case "WW-CamerasMenu":
if (camerasMenuOpen == false)
{ document.getElementById('WW-CamerasMenu').style.display='none';
document.getElementById('WW-CamerasMenuImg').src='../../Images/Links/CamerasOff.gif';
}
break;
}
}
function hideAllMenus(menuName)
{ if (menuName != "WW-NewsMenu") if (document.getElementById('WW-NewsMenu').style.display != 'none') hideMenu('WW-NewsMenu');
if (menuName != "WW-HealthMenu") if (document.getElementById('WW-HealthMenu').style.display != 'none') hideMenu('WW-HealthMenu');
if (menuName != "WW-VideosMenu") if (document.getElementById('WW-VideosMenu').style.display != 'none') hideMenu('WW-VideosMenu');
if (menuName != "WW-PhotosMenu") if (document.getElementById('WW-PhotosMenu').style.display != 'none') hideMenu('WW-PhotosMenu');
if (menuName != "WW-CamerasMenu") if (document.getElementById('WW-CamerasMenu').style.display != 'none') hideMenu('WW-CamerasMenu');
}
function closeMenu(menuName, closeImmediately)
{ closeImmediately = closeImmediately || false;
if (closeImmediately == false)
setTimeout("hideMenu('" + menuName + "')", 500);
else
setTimeout("hideMenu('" + menuName + "')", 0);
}
//*******************
//* Skin Settings *
//*******************
function loadSkinSettings()
{ //****************************
//* Load bar graph display *
//****************************
switch (document.getElementById("WW-SkinOption7").innerHTML)
{ case "Hide":
document.getElementById("WW-Graphs").style.display = "none";
break;
default:
if (document.getElementById("WW-Current-View").style.display == "")
{ document.getElementById("WW-Graphs").style.display = "";
}
break;
}
//***************************
//* Load news bar display *
//***************************
switch (document.getElementById("WW-SkinOption4").innerHTML)
{ case "Hide":
document.getElementById("WW-News-Bar").style.display = "none";
break;
default:
document.getElementById("WW-News-Bar").style.display = "";
break;
}
//*************************
//* Load slider display *
//*************************
document.getElementById("SliderDIV").style.left = "32px";
try
{ switch (document.getElementById("WW-SkinOption2").innerHTML)
{ case "Days":
document.getElementById("WW-Day-Slider").style.display = "";
document.getElementById("WW-Moon-Slider").style.display = "none";
document.getElementById("WW-Hour-Slider").style.display = "none";
break;
case "Moons":
document.getElementById("WW-Moon-Slider").style.display = "";
document.getElementById("WW-Day-Slider").style.display = "none";
document.getElementById("WW-Hour-Slider").style.display = "none";
break;
default:
document.getElementById("WW-Moon-Slider").style.display = "none";
switch (document.getElementById("WW-IsInternational").innerHTML)
{ case "False":
document.getElementById("WW-Day-Slider").style.display = "none";
document.getElementById("WW-Hour-Slider").style.display = "";
break;
default:
document.getElementById("WW-Day-Slider").style.display = "";
document.getElementById("WW-Hour-Slider").style.display = "none";
break;
}
break;
}
}
catch(err){}
//****************************
//* Load thermometer color *
//****************************
switch (document.getElementById("WW-SkinOption1").innerHTML)
{ case "Blue":
document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png') bottom";
break;
case "BlueRed":
if (parseInt(plainTemp) < 33)
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png') bottom";
}
else
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbRed.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png') bottom";
}
break;
case "RedBlue":
if (parseInt(plainTemp) < 33)
{ document.getElementById("WW-Thermometer-Bulb").style.background = "url('../../Images/ThermBulbRed.png')";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png') bottom";
}
else
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png') bottom";
}
break;
default:
document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbRed.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png') bottom";
break;
}
//***************************
//* Load wind gauge arrow *
//***************************
switch (document.getElementById("WW-SkinOption3").innerHTML)
{ case "Reverse":
windArrowDirection = "R";
break;
default:
windArrowDirection = "S";
break;
}
//***************************************
//* Set daily forecast more/less link *
//***************************************
switch (document.getElementById("WW-SkinOption5").innerHTML)
{ case "More":
dailyForecastShowMore();
break;
default:
dailyForecastShowLess();
break;
}
}
//**********************************************************************************************************
//* The following functions are called from the Weather Watcher main window when the buttons are clicked *
//**********************************************************************************************************
function displayCurrent()
{ try
{ if (document.getElementById("WW-Current-View").style.display = "none")
{ showHideSlider(true);
showHideGauges(true);
document.getElementById("WeatherBug-Logo").style.display = "";
if (document.getElementById("WW-SkinOption7").innerHTML != "Hide")
{ document.getElementById("WW-Graphs").style.display = "";
}
document.getElementById("WW-Status-Bar").style.display = "";
document.getElementById("WW-Day-View").style.display = "none";
document.getElementById("WW-Current-View").style.display = "";
document.getElementById("WW-Hour-View").style.display = "none";
}
}
catch(err){}
}
function displayHour()
{ if (document.getElementById("WW-Hour-View").style.display = "none")
{ showHideSlider(false);
showHideGauges(false);
document.getElementById("WeatherBug-Logo").style.display = "none";
document.getElementById("WW-Graphs").style.display = "none";
document.getElementById("WW-Status-Bar").style.display = "none";
document.getElementById("WW-Current-View").style.display = "none";
switch (document.getElementById("WW-IsInternational").innerHTML)
{ case "False":
document.getElementById("WW-Day-View").style.display = "none";
document.getElementById("WW-Hour-View").style.display = "";
break;
default:
document.getElementById("WW-Day-View").style.display = "";
document.getElementById("WW-Hour-View").style.display = "none";
break;
}
}
}
function displayDay()
{ if (document.getElementById("WW-Day-View").style.display = "none")
{ showHideSlider(false);
showHideGauges(false);
document.getElementById("WeatherBug-Logo").style.display = "none";
document.getElementById("WW-Graphs").style.display = "none";
document.getElementById("WW-Status-Bar").style.display = "none";
document.getElementById("WW-Current-View").style.display = "none";
document.getElementById("WW-Day-View").style.display = "";
document.getElementById("WW-Hour-View").style.display = "none";
}
}
//******************************
//* Daily forecast functions *
//******************************
function dailyForecastShowMore()
{ hideDIVs("WW-DailyLess");
hideDIVs("WW-DailyPrediction");
hideDIVs("WW-DailyConditionBold");
showDIVs("WW-DailyCondition");
showDIVs("WW-DailyMore");
updateDIVs("WW-SkinOption5", "More");
setRunAction("SaveSkinSettings");
}
function dailyForecastShowLess()
{ hideDIVs("WW-DailyMore");
hideDIVs("WW-DailyCondition");
showDIVs("WW-DailyConditionBold");
showDIVs("WW-DailyLess");
showDIVs("WW-DailyPrediction");
updateDIVs("WW-SkinOption5", "Less");
setRunAction("SaveSkinSettings");
}
//**********************
//* Slider functions *
//**********************
function showHideSlider(makeVisible)
{ if (makeVisible == true)
{ document.getElementById("SliderDIV").style.display = "";
document.getElementById("SliderEnd").style.display = "";
}
else
{ document.getElementById("SliderDIV").style.display = "none";
document.getElementById("SliderEnd").style.display = "none";
}
}
function resetSliderPosition()
{ document.getElementById("SliderDIV").style.left = "32px";
}
function showHideGauges(makeVisible)
{ if (makeVisible == true)
{ document.getElementById("WW-Gauges").style.display = "";
document.getElementById("Right-Border").style.display = "none";
}
else
{ document.getElementById("WW-Gauges").style.display = "none";
document.getElementById("Right-Border").style.display = "";
}
}
//************************
//* Realtime functions *
//************************
function refreshRealtimeData(updated, updatedTimeStamp, currentTemp, currentTempC, highTemp, highTempC, lowTemp, lowTempC, feelsLikeTemp, feelsLikeTempC, tempRate, tempRateC, wetBulb, wetBulbC, dewPoint, dewPointC, humidity, humidityHigh, humidityLow, humidityRate, rain, rainC, rainRate, rainRateC, rainRateMax, rainRateMaxC, rainMonth, rainMonthC, windDirection, windDirectionAvg, windSpeed, windSpeedC, windSpeedAvg, windSpeedAvgC, windGustDirection, windGust, windGustC, pressure, pressureC, pressureHigh, pressureHighC, pressureLow, pressureLowC, pressureRate, pressureRateC, tempDisplayBoth, tempDisplayPrimary, windInDegrees, localDecimalSep)
{ updateDIVs("WW-Updated", updated);
updateDIVs("WW-Updated-Replaced", updated.replace("Observed","Updated"));
graphLoad("WW-TempGraph", "Temperature", "-30", "130", lowTemp, iif((tempDisplayPrimary == "C"), lowTempC, lowTemp), currentTemp, iif(tempDisplayPrimary == "C", roundTemperature(currentTempC), roundTemperature(currentTemp)), highTemp, iif(tempDisplayPrimary == "C", highTempC, highTemp), "");
graphLoad("WW-PressureGraph", "Pressure", "27", "32", pressureLow, iif((pressureLowC != "N/A"), pressureLowC.replace(".",localDecimalSep), pressureLow.replace(".",localDecimalSep)), pressure, iif(pressureC != "N/A", pressureC.replace(".",localDecimalSep), pressure.replace(".",localDecimalSep)), pressureHigh, iif(pressureHighC != "N/A", pressureHighC.replace(".",localDecimalSep), pressureHigh.replace(".",localDecimalSep)), "");
graphLoad("WW-HumidityGraph", "Humidity", "-10", "120", humidityLow, humidityLow, humidity, humidity, humidityHigh, humidityHigh, "");
graphLoad("WW-WindGraph", "Wind", "-10", "60", "", "", windSpeed, iif((windSpeedC != "N/A"), windSpeedC, windSpeed), iif(windGust == "N/A", "", windGust), iif((windGustC != "N/A"), windGustC, iif(windGust == "N/A", "", windGust)), "");
if (humidity != "N/A") humidity = humidity + "%";
if (humidityLow != "N/A") humidityLow = humidityLow + "%";
if (humidityHigh != "N/A") humidityHigh = humidityHigh + "%";
if (humidityRate != "N/A") humidityRate = humidityRate + "%";
updateDIVs("WW-Barometer-Rate", pressureHigh);
updateDIVs("WW-CurrentHumidity", humidity);
updateDIVs("WW-HumidityLow", humidityLow);
updateDIVs("WW-HumidityHigh", humidityHigh);
updateDIVs("WW-HumidityRate", humidityRate);
updateDIVs("WW-WindDirectionAvg", windDirectionAvg);
updateDIVs("WW-WindGustDirection", windGustDirection);
document.getElementById("WW-BarometerGauge-Text").innerHTML = iif(pressureC != "N/A", pressureC.replace(".",localDecimalSep), pressure.replace(".",localDecimalSep));
if (windDirectionAvg != "N/A") updateDIVs("WW-WindDegreesAvg", convertWindDirectionToDegrees(windDirectionAvg) + "°");
else updateDIVs('WW-WindDegreesAvg', windDirection);
if (windGustC != "N/A")
{ updateDIVs("WW-WindGust", windGustC);
}
else
{ updateDIVs("WW-WindGust", windGust);
}
if (pressureLowC != "N/A") updateDIVs("WW-BarometerLow", pressureLowC);
else updateDIVs("WW-BarometerLow", pressureLow);
if (pressureHighC != "N/A") updateDIVs("WW-BarometerHigh", pressureHighC);
else updateDIVs("WW-BarometerHigh", pressureHigh);
if (pressureRateC != "N/A") updateDIVs("WW-BarometeRate", pressureRateC);
else updateDIVs("WW-BarometerRate", pressureRate);
refreshRealtimeTemps(currentTemp, currentTempC, highTemp, highTempC, lowTemp, lowTempC, feelsLikeTemp, feelsLikeTempC, tempRate, tempRateC, wetBulb, wetBulbC, dewPoint, dewPointC, tempDisplayBoth, tempDisplayPrimary);
if (windSpeedC != "N/A") windSpeed = windSpeedC;
refreshRealtimeWindData(convertWindDirectionToDegrees(windDirection), windSpeed, feelsLikeTemp);
}
function refreshRealtimeTemps(currentTemp, currentTempC, highTemp, highTempC, lowTemp, lowTempC, feelsLikeTemp, feelsLikeTempC, tempRate, tempRateC, wetBulb, wetBulbC, dewPoint, dewPointC, tempDisplayBoth, tempDisplayPrimary)
{ if (tempDisplayPrimary == "C")
{ updateTemperature(currentTempC + "°", currentTempC, highTempC, feelsLikeTempC);
if (currentTempC != "N/A")
{ if (tempDisplayBoth == false)
{ currentTempC = currentTempC + "°";
}
else
{ currentTempC = currentTempC + "°/" + currentTemp + "°";
}
}
if (lowTempC != "N/A")
{ if (tempDisplayBoth == false)
{ lowTempC = lowTempC + "°";
}
else
{ lowTempC = lowTempC + "°/" + lowTemp + "°";
}
}
if (highTempC != "N/A")
{ if (tempDisplayBoth == false)
{ highTempC = highTempC + "°";
}
else
{ highTempC = highTempC + "°/" + highTemp + "°";
}
}
if (feelsLikeTempC != "N/A")
{ if (tempDisplayBoth == false)
{ feelsLikeTempC = feelsLikeTempC + "°";
}
else
{ feelsLikeTempC = feelsLikeTempC + "°/" + feelsLikeTemp + "°";
}
}
if (dewPointC != "N/A")
{ if (tempDisplayBoth == false)
{ dewPointC = dewPointC + "°";
}
else
{ dewPointC = dewPointC + "°/" + dewPoint + "°";
}
}
updateDIVs("WW-CurrentTemp", currentTempC);
updateDIVs("WW-TempLow", lowTempC);
updateDIVs("WW-TempHigh", highTempC);
updateDIVs("WW-CurrentFeelsLikeTemp", feelsLikeTempC);
updateDIVs("WW-CurrentDew", dewPointC);
}
else
{ updateTemperature(currentTemp + "°", currentTemp, highTemp, feelsLikeTemp);
if (currentTemp != "N/A")
{ if (tempDisplayBoth == false)
{ currentTemp = currentTemp + "°";
}
else
{ currentTemp = currentTemp + "°/" + currentTempC + "°";
}
}
if (lowTemp != "N/A")
{ if (tempDisplayBoth == false)
{ lowTemp = lowTemp + "°";
}
else
{ lowTemp = lowTemp + "°/" + lowTempC + "°";
}
}
if (highTemp != "N/A")
{ if (tempDisplayBoth == false)
{ highTemp = highTemp + "°";
}
else
{ highTemp = highTemp + "°/" + highTempC + "°";
}
}
if (feelsLikeTemp != "N/A")
{ if (tempDisplayBoth == false)
{ feelsLikeTemp = feelsLikeTemp + "°";
}
else
{ feelsLikeTemp = feelsLikeTemp + "°/" + feelsLikeTempC + "°";
}
}
if (dewPoint != "N/A")
{ if (tempDisplayBoth == false)
{ dewPoint = dewPoint + "°";
}
else
{ dewPoint = dewPoint + "°/" + dewPointC + "°";
}
}
updateDIVs("WW-CurrentTemp", currentTemp);
updateDIVs("WW-TempLow", lowTemp);
updateDIVs("WW-TempHigh", highTemp);
updateDIVs("WW-CurrentFeelsLikeTemp", feelsLikeTemp);
updateDIVs("WW-CurrentDew", dewPoint);
}
}
//*****************************
//* Realtime wind functions *
//*****************************
function refreshRealtimeWindData(windDirection, windSpeed, windChill, windSpeedPlain, windChillPlain)
{ var tmpWindSpeed = windSpeed.replace(",",".");
if (isNaN(tmpWindSpeed))
{ windSpeed = "0";
}
else if (windSpeed == "NA")
{ windSpeed = "0";
}
if (isNaN(windSpeedPlain))
{ windSpeedPlain = "0";
}
else if (windSpeedPlain == "NA")
{ windSpeedPlain = "0";
}
//windSpeed = windSpeed.replace(",","");
document.getElementById("WW-WindGauge-Text").innerHTML = windSpeed;
updateDIVs("WW-CurrentWind", windSpeed);
updateDIVs("WW-CurrentWindDirection", convertWindDegreesToDirection(windDirection));
graphLoad("WW-WindGraph", "Wind", "-10", "60", "", "", windSpeed, iif((windSpeed != windSpeedPlain), windSpeed, windSpeedPlain), "", "", "");
windDirection = roundWindDirection(windDirection);
if (isNaN(lastWindDirection) || windDirection == lastWindDirection)
{ document.getElementById("WW-WindGauge-Image").src = "../../Images/Wind/" + windDirection + ".gif";
}
else
{ var imageFileName = "../../Images/Wind/" + lastWindDirection + "-" + windDirection + ".gif";
if (imageExists(imageFileName) == true) document.getElementById("WW-WindGauge-Image").src = imageFileName + "?" + getUniqueNumber;
else document.getElementById("WW-WindGauge-Image").src = "../../Images/Wind/" + windDirection + ".gif";
}
lastWindDirection = windDirection;
}
function roundWindDirection(windDirection)
{ var degree;
if (windArrowDirection == "S")
{ windDirection = parseInt(windDirection) + 180;
if (windDirection > 359) windDirection = windDirection - 360;
}
//*************************************************
//* Round wind direction if not already rounded *
//*************************************************
if (("|345|330|315|300|285|270|255|240|225|210|195|180|165|150|135|120|105|90|75|60|45|30|15|0|").indexOf("|" + windDirection + "|") == -1)
{ if (windDirection > 352) degree = 0;
else if (windDirection > 337) degree = 345;
else if (windDirection > 322) degree = 330;
else if (windDirection > 307) degree = 315;
else if (windDirection > 292) degree = 300;
else if (windDirection > 269) degree = 285;
else if (windDirection > 262) degree = 270;
else if (windDirection > 247) degree = 255;
else if (windDirection > 232) degree = 240;
else if (windDirection > 217) degree = 225;
else if (windDirection > 202) degree = 210;
else if (windDirection > 187) degree = 195;
else if (windDirection > 172) degree = 180;
else if (windDirection > 157) degree = 165;
else if (windDirection > 142) degree = 150;
else if (windDirection > 127) degree = 135;
else if (windDirection > 112) degree = 120;
else if (windDirection > 97) degree = 105;
else if (windDirection > 82) degree = 90;
else if (windDirection > 67) degree = 75;
else if (windDirection > 52) degree = 60;
else if (windDirection > 37) degree = 45;
else if (windDirection > 22) degree = 30;
else if (windDirection > 7) degree = 15;
else degree = 0;
}
else
{ degree = windDirection;
}
return degree;
}
function convertWindDegreesToDirection(windDegrees)
{ var direction;
if (windDegrees > 348.75) direction = "N";
else if (windDegrees > 326.25) direction = "NNW";
else if (windDegrees > 303.75) direction = "NW";
else if (windDegrees > 281.25) direction = "WNW";
else if (windDegrees > 258.75) direction = "W";
else if (windDegrees > 236.25) direction = "WSW";
else if (windDegrees > 213.75) direction = "SW";
else if (windDegrees > 191.25) direction = "SSW";
else if (windDegrees > 168.75) direction = "S";
else if (windDegrees > 146.25) direction = "SSE";
else if (windDegrees > 123.75) direction = "SE";
else if (windDegrees > 101.25) direction = "ESE";
else if (windDegrees > 78.75) direction = "E";
else if (windDegrees > 56.25) direction = "ENE";
else if (windDegrees > 33.75) direction = "NE";
else if (windDegrees > 11.25) direction = "NNE";
else direction = "N";
return direction;
}
function convertWindDirectionToDegrees(windDirection)
{ switch(windDirection)
{ case "N": return "0"; break;
case "NNE": return "23"; break;
case "NE": return "45"; break;
case "ENE": return "68"; break;
case "E": return "90"; break;
case "ESE": return "113"; break;
case "SE": return "135"; break;
case "SSE": return "158"; break;
case "S": return "180"; break;
case "SSE": return "158"; break;
case "S": return "180"; break;
case "SSW": return "203"; break;
case "SW": return "225"; break;
case "WSW": return "248"; break;
case "W": return "270"; break;
case "WNW": return "293"; break;
case "NW": return "315"; break;
default: return "0"; break;
}
}
function roundTemperature(temp)
{ if (temp != "NA")
{ temp = temp.replace(",",".");
if (parseInt(temp).toString() != temp.toString())
{ if (temp > 0)
{ temp = parseFloat(temp) + 0.5;
}
else if (temp < 0)
{ temp = parseFloat(temp) - 0.5;
}
temp = parseInt(temp);
}
}
return temp;
}
function graphLoad(graphName, graphCaption, graphMinValue, graphMaxValue, barValue1, barCaption1, barValue2, barCaption2, barValue3, barCaption3, barValueSuffix)
{ var graph = document.getElementById(graphName);
if (graph)
{ document.getElementById(graphName + "-Caption").innerHTML = graphCaption;
if (barValue1.length > 0)
{ if (parseInt(barValue1) > parseInt(graphMaxValue)) barValue1 = graphMaxValue;
if (parseInt(barValue1) < parseInt(graphMinValue)) barValue1 = graphMinValue;
graphSetBarValue(graphName + "-Bar1", graphMinValue, graphMaxValue, barValue1, barCaption1, barValueSuffix);
}
if (barValue2.length > 0)
{ if (parseInt(barValue2) > parseInt(graphMaxValue)) barValue2 = graphMaxValue;
if (parseInt(barValue2) < parseInt(graphMinValue)) barValue2 = graphMinValue;
graphSetBarValue(graphName + "-Bar2", graphMinValue, graphMaxValue, barValue2, barCaption2, barValueSuffix);
}
if (barValue3.length > 0)
{ if (parseInt(barValue3) > parseInt(graphMaxValue)) barValue3 = graphMaxValue;
if (parseInt(barValue3) < parseInt(graphMinValue)) barValue3 = graphMinValue;
graphSetBarValue(graphName + "-Bar3", graphMinValue, graphMaxValue, barValue3, barCaption3, barValueSuffix);
}
}
}
function graphSetBarValue(graphBarName, graphMinValue, graphMaxValue, graphValue, graphCaption, graphValueSuffix)
{ var graphBar = document.getElementById(graphBarName + "-Value");
if (graphBar)
{ var barTop = document.getElementById(graphBarName + "-Top");
var barBottom = document.getElementById(graphBarName + "-Bottom");
if (isNumeric(graphValue) == false)
{ switch (parseInt(graphMinValue))
{ case -30: graphValue = -20; break;
case -10: graphValue = 0; break;
case 27: graphValue = 28; break;
default: graphValue = graphMinValue; break;
}
graphCaption = graphValue;
}
if (graphValueSuffix == null) graphValueSuffix = "";
var gHeight = parseInt(graphMaxValue) - parseInt(graphMinValue);
var gTopHeight = parseInt(graphMaxValue) - parseInt(graphValue);
var gBottomHeight = parseInt(graphValue) - parseInt(graphMinValue);
barTop.style.height = 100 * (parseInt(gTopHeight) / parseInt(gHeight)) + "%";
barBottom.style.height = 100 * (parseInt(gBottomHeight) / parseInt(gHeight)) + "%";
graphCaption = graphCaption.substring(0, 4);
graphBar.innerHTML = graphCaption + graphValueSuffix;
}
}
function getMapExtension()
{ var strMapLink = document.getElementById("WW-SkinOption20").innerHTML + "";
var strMapLinkPrefix = "";
var strMapLinkExtension = "";
if (strMapLink.length == 0)
{ return "jpg";
}
else
{ strMapLinkPrefix = left(strMapLink, 4).toLowerCase();
strMapLinkExtension = right(strMapLink, 3).toLowerCase();
if (strMapLinkPrefix == "http" && ((strMapLinkExtension == "gif") || (strMapLinkExtension == "jpg") || (strMapLinkExtension == "png")))
{ return strMapLinkExtension;
}
else
{ return "jpg";
}
}
}